import request from '@/utils/request'
// 获取经纪列表
export function getAgentsList(params) {
  return request(
    {
      url: '/agents',
      params
    }
  )
}

// 获取经纪数量
export function agentTotal(params) {
  return request({
    url: `/agents/count/`,
    params
  })
}

// 新建经纪
export function addAgents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 获取指定经纪
export function getOneAgents(id) {
  return request({
    url: `/agents/${id}`
  })
}

// 编辑经纪
export function deitAgents(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}

// 删除经纪
export function delAgents(id) {
  return request({
    url: `/agents/${id}`,
    method: 'delete'
  })
}
